import request from '@/utils/request'

// 查询套餐管理列表
export function listCombo(query) {
  return request({
    url: '/system/onlyCombo/list',
    method: 'get',
    params: query
  })
}

//获取全部菜品信息
export function listAllDishes(query) {
  return request({
    url: '/system/onlyCombo/allDishesList',
    method: 'get',
    params: query
  })
}

//获取全部主食饮品信息
export function listAllMainAndDrink(query) {
  return request({
    url: '/system/onlyCombo/allMainAndDrink',
    method: 'get',
    params: query
  })
}
// 查询套餐管理详细
export function getCombo(comboDishesId) {
  return request({
    url: '/system/onlyCombo/' + comboDishesId,
    method: 'get'
  })
}

// 新增套餐管理
export function addCombo(data) {
  return request({
    url: '/system/onlyCombo',
    method: 'post',
    data: data
  })
}

// 修改套餐管理
export function updateCombo(data) {
  return request({
    url: '/system/onlyCombo',
    method: 'put',
    data: data
  })
}

//修改管理状态
export function changeComboStatus(comboDishesId, packageId) {
  const data = {
    comboDishesId,
    packageId
  }
  return request({
    url: '/system/onlyCombo/changeStatus',
    method: 'put',
    data: data
  })
}

//购物车修改
export function shoppingChange(dishesId,shoppingChange) {
  const data={
    dishesId,
    shoppingChange
  }
  return request({
    url: '/system/coldDishes/shoppingChange',
    method: 'put',
    data: data
  })
}

// 删除套餐管理
export function delCombos(comboDishesId) {
  return request({
    url: '/system/onlyCombo/' + comboDishesId,
    method: 'delete'
  })

}
